<%--
  Created by IntelliJ IDEA.
  User: Samps
  Date: 2018-9-23
  Time: 18:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>userInfo</title>
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>






</head>
<body>
<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title">修改用户名密码信息</h3>
    </div>
    <!-- /.box-header -->
    <!-- form start -->

    <form role="form">
        <div class="box-body">
            <div class="form-group">
                <label id="errorMess"></label>
                <label for="username">用户名</label>
                <input type="text" class="form-control" id="username" name="username" placeholder="用户名" value=${member.userName}>
            </div>
            <div class="form-group">
                <label for="pwd">密码</label>
                <input type="password" class="form-control" id="pwd" name="pwd" placeholder="密码">
            </div>
            <div class="form-group">
                <label for="pwd">确认密码</label>
                <input type="password" class="form-control" id="PasswordConfirm" name="pwd" placeholder="确认密码">
            </div>


        </div>
        <!-- /.box-body -->

        <div class="box-footer">
            <button id="updateButton" type="button" class="btn btn-primary">提交</button>
        </div>
    </form>
</div>

<script src="../../bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="../../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- FastClick -->
<script src="../../bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<script >
    $(document).ready(function () {
        $("#updateButton").click(function () {
            if ($("#pwd").val()==$("#PasswordConfirm").val()) {
                $.post(
                    "/updateUser",
                    {"userName":$("#username").val(),"pwd":$("#pwd").val()},
                    function (data) {
                        if (data.status==1){
                            window.location.href="/login";
                        }else{
                            $("#errorMess").text(data.message);
                        }
                    });
            }else {
                $("#errorMess").text("密码和重复密码不一致");
            }

        });
    });

</script>

</body>
</html>
